package com.systemframework.config;

import cn.dev33.satoken.stp.StpInterface;
import cn.hutool.core.convert.Convert;
import com.systemframework.sys.dto.response.SysUserResponseDTO;
import com.systemframework.sys.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author summer
 * @date 2023-03-22 9:37
 */
@Component
public class StpInterfaceImpl implements StpInterface {

    private SysUserService sysUserService;

    @Autowired
    public void setSysUserService(SysUserService sysUserService) {
        this.sysUserService = sysUserService;
    }


    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        return sysUserService.permissionLists(Convert.convert(Integer.class, loginId));
    }



    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return sysUserService.roleMarkLists(Convert.convert(Integer.class, loginId));
    }
}
